package cn.gson.crm.model.pojo;

import java.io.Serializable;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;


/**
 * The persistent class for the ORDERDETAILS1 database table.
 * 
 */
@Entity
@NamedQuery(name="Orderdetails1.findAll", query="SELECT o FROM Orderdetails1 o")
public class Orderdetails1 implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(initialValue=1,allocationSize=1,name="ORDERDETAILS1_ODID_GENERATOR", sequenceName="SEQ_32")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="ORDERDETAILS1_ODID_GENERATOR")
	@Column(name="OD_ID")
	private long odId;

	@Column(name="OD_CO_ID")
	private BigDecimal odCoId;

	@Column(name="OD_CUS_ID")
	private BigDecimal odCusId;

	@Column(name="OD_CUS_NAME")
	private String odCusName;

	@Column(name="OD_IF_SAY")
	private String odIfSay;

	@Column(name="OD_NUMBER")
	private BigDecimal odNumber;

	@Column(name="OD_OWNER")
	private String odOwner;

	@Temporal(TemporalType.DATE)
	@Column(name="OD_PLAN_TIME")
	private Date odPlanTime;

	@Column(name="OD_PRICE")
	private BigDecimal odPrice;

	@Column(name="OD_PRO_ID")
	private BigDecimal odProId;

	@Column(name="OD_PRO_NAME")
	private String odProName;

	@Column(name="OD_PRO_TYPE")
	private String odProType;

	@Column(name="OD_REMARKS")
	private String odRemarks;

	//bi-directional many-to-one association to ConstactOrder
	@ManyToOne
	@JoinColumn(name="CO_ID")
	private ConstactOrder constactOrder;

	//bi-directional many-to-one association to Customerinfo
	@ManyToOne
	@JoinColumn(name="CUST_ID")
	private Customerinfo customerinfo;

	//bi-directional many-to-one association to Product
	@ManyToOne
	@JoinColumn(name="PRODUCT_ID")
	private Product product;

	//bi-directional many-to-one association to Product
	@OneToMany(mappedBy="orderdetails1")
	private List<Product> products;

	public Orderdetails1() {
	}

	public long getOdId() {
		return this.odId;
	}

	public void setOdId(long odId) {
		this.odId = odId;
	}

	public BigDecimal getOdCoId() {
		return this.odCoId;
	}

	public void setOdCoId(BigDecimal odCoId) {
		this.odCoId = odCoId;
	}

	public BigDecimal getOdCusId() {
		return this.odCusId;
	}

	public void setOdCusId(BigDecimal odCusId) {
		this.odCusId = odCusId;
	}

	public String getOdCusName() {
		return this.odCusName;
	}

	public void setOdCusName(String odCusName) {
		this.odCusName = odCusName;
	}

	public String getOdIfSay() {
		return this.odIfSay;
	}

	public void setOdIfSay(String odIfSay) {
		this.odIfSay = odIfSay;
	}

	public BigDecimal getOdNumber() {
		return this.odNumber;
	}

	public void setOdNumber(BigDecimal odNumber) {
		this.odNumber = odNumber;
	}

	public String getOdOwner() {
		return this.odOwner;
	}

	public void setOdOwner(String odOwner) {
		this.odOwner = odOwner;
	}

	public Date getOdPlanTime() {
		return this.odPlanTime;
	}

	public void setOdPlanTime(Date odPlanTime) {
		this.odPlanTime = odPlanTime;
	}

	public BigDecimal getOdPrice() {
		return this.odPrice;
	}

	public void setOdPrice(BigDecimal odPrice) {
		this.odPrice = odPrice;
	}

	public BigDecimal getOdProId() {
		return this.odProId;
	}

	public void setOdProId(BigDecimal odProId) {
		this.odProId = odProId;
	}

	public String getOdProName() {
		return this.odProName;
	}

	public void setOdProName(String odProName) {
		this.odProName = odProName;
	}

	public String getOdProType() {
		return this.odProType;
	}

	public void setOdProType(String odProType) {
		this.odProType = odProType;
	}

	public String getOdRemarks() {
		return this.odRemarks;
	}

	public void setOdRemarks(String odRemarks) {
		this.odRemarks = odRemarks;
	}

	public ConstactOrder getConstactOrder() {
		return this.constactOrder;
	}

	public void setConstactOrder(ConstactOrder constactOrder) {
		this.constactOrder = constactOrder;
	}

	public Customerinfo getCustomerinfo() {
		return this.customerinfo;
	}

	public void setCustomerinfo(Customerinfo customerinfo) {
		this.customerinfo = customerinfo;
	}

	public Product getProduct() {
		return this.product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

	public List<Product> getProducts() {
		return this.products;
	}

	public void setProducts(List<Product> products) {
		this.products = products;
	}

	public Product addProduct(Product product) {
		getProducts().add(product);
		product.setOrderdetails1(this);

		return product;
	}

	public Product removeProduct(Product product) {
		getProducts().remove(product);
		product.setOrderdetails1(null);

		return product;
	}

}